﻿using System;
using System.Data;
using System.Data.SqlClient;

namespace WebApplication1
{
    internal class DbHelper
    {
       
            public static readonly string conString = "server=.;database=CMS;uid=sa;pwd=123456;";
            public static DataTable GetTable(string sql)
            {
                SqlDataAdapter adapter = new SqlDataAdapter(sql, conString);
                DataTable dt = new DataTable();
                adapter.Fill(dt);
                return dt;
            }
            public static void ADDD(string sql)
            {
                SqlConnection connection = new SqlConnection(conString);
                SqlCommand command = new SqlCommand(sql, connection);
                connection.Open();
                command.ExecuteNonQuery();
                connection.Close();
            }
        }
}